/*import Vue from 'vue'*/
export default function(Vue){
  Vue.filter('numberThousand',function(num){
    if(num==null||num==undefined||isNaN(num)){
      return "-"
    }else{
      var num=parseFloat(num);
      var num0='';
      num=(num||0).toFixed(2).toString();
      if(Number(num)<0){
        num=num.split('-')[1];
        num0='-';
      }
      var num1=num.split('.')[0];//小数点前
      var num2=num.split('.')[1];//小数点后
      var result='';
      while(num1.length>3){
        result=','+num1.slice(-3)+result;
        num1=num1.slice(0,num1.length-3);
      }
      if(num1){
        result=num0+num1+result;
      }
      if(num2=='00'){
        result=num0+result;
        return result
      }else{
        result=result+'.'+num2;
        return result
      }
    }
  });
  Vue.filter('numberPercent',function (num) {
    if(num==undefined||num==null||num==''||isNaN(num)){
      return '-'
    }else{
      num=parseFloat(num*100).toFixed(2);
      return num+'%'
    }
  })
  Vue.filter('classCategory',function(className){
    return className==null?'E':className;
  })
  Vue.filter('date10Filter',function(date){
    if(date==undefined||date==null||date==''){
      return '-'
    }else{
      return date==null?'-':date.substr(0,10);
    }
  })
}
